package class202205.demo10.demo09.sqlist;

public class TestDemo {
    public static void main(String[] args) {
        MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(0,1);
        myArraylist.add(1,2);
        myArraylist.add(2,3);
        myArraylist.add(3,4);
        myArraylist.add(4,5);
        myArraylist.display();
        myArraylist.set(0,199);
        myArraylist.display();
    }
    public static void main1(String[] args) {
        //打印顺序表
        /*MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(1);
        myArraylist.add(2);
        myArraylist.add(3);
        myArraylist.add(4);
        myArraylist.add(5);
        myArraylist.display();*/
        //pos位置新增
        MyArraylist myArraylist = new MyArraylist();
        /*myArraylist.add(0,1);
        myArraylist.add(1,2);
        myArraylist.add(2,3);
        myArraylist.add(3,4);
        myArraylist.add(4,5);

        myArraylist.add(0,999);
        myArraylist.add(6,99);
        myArraylist.add(3,9);
        //会放到最后 默认重载
        myArraylist.add(9999);
        myArraylist.display();*/
        System.out.println("================");
        int ret = myArraylist.get(2);
        System.out.println(ret);
    }
}
